import requests,json
import pandas as pd
# 搜索POI
my_key ="5bd1ca4e7bc885ff80882a4f8b45093b"
key = my_key
# 高德天气查询api代码
def tianqi(key, city):
    weather_url = 'https://restapi.amap.com/v3/weather/weatherInfo?parameters'
    key = '5bd1ca4e7bc885ff80882a4f8b45093b'
    params = {
        "key": my_key,
        "city": city,
        "extensions": 'base',
        "output": "JSON"
    }
    response = requests.get(weather_url, params)
    tianqi = response.json()['lives'][0]
    return tianqi


# 搜索POI
def place(key="5bd1ca4e7bc885ff80882a4f8b45093b",keywords='keywords',city=None):
    place_url="https://restapi.amap.com/v3/place/text?parameters"
    params={
    "key":my_key,
    "keywords":keywords,
    "city":city,
}
    r=requests.get(place_url,params=params)
    place=r.json()['pois']
    return place